﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Kassasysteem_TacoTruijens
{
    public partial class paymultifareticket : System.Web.UI.Page
    {
        private DataClassesDataContext Database = new DataClassesDataContext();

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        private BijzondereKaart createMultifareTicket()
        {
            BijzondereKaart specialTicket = new BijzondereKaart();
            specialTicket.Type = "Tienrittenkaart";
            specialTicket.Verloopdatum = DateTime.Now.AddYears(2);

            Database.BijzondereKaarts.InsertOnSubmit(specialTicket);
            Database.SubmitChanges();

            return specialTicket;
        }

        protected void buttonNext_Click(object sender, EventArgs e)
        {
            BijzondereKaart specialTicket = createMultifareTicket();
            String queryString = "printmultifareticket.aspx?enddate=" + specialTicket.Verloopdatum.ToString();
            Response.Redirect(queryString);
        }
    }
}